package com.bt.springboot.task.delay;

import lombok.extern.slf4j.Slf4j;

import java.util.Timer;
import java.util.TimerTask;

/**
 * @author zkx
 * @Date 2023/9/26 13:14
 */
@Slf4j
public class TimerDemo {

	public static void main(String[] args) {
		Timer timer = new Timer();
		log.info("提交延迟任务");
		int i = 5000;
		TimerTask task = new TimerTask() {
			@Override
			public void run() {
				log.info("执行延迟任务");
			}
		};
		timer.schedule(task,5000);
	}
}
